package homeWork.SOC5.mission_2;

/**
 * 普通人类 的尸体描述类
 *      实现接口:Man
 */
public class NormalMan implements Man {

    private String name;

    /* 人类社会中必须有姓名这个属性，不能空参
    public NormalMan(){
    }
    */

    public NormalMan(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public NormalMan setName(String name) {
        this.name = name;
        return this;
    }

    @Override
    public void think() {
        System.out.println(this.name + ": " + "用脑来思考");

    }

    @Override
    public void study() {
        System.out.println(this.name + ": " + "通过读书来学习");
    }

    @Override
    public void eat() {
        System.out.println(this.name + ": " + "吃的是食物");
    }

    @Override
    public void hasSex() {
        System.out.println(this.name + ": " + "有性别之分");
    }

    @Override
    public void breath() {
        System.out.println(this.name + ": " + "通过肺部来呼吸");
    }

    public static void main(String[] args){
        //实现方法1.实例化接口对象指向NormalMan类
        //Man man = new NormalMan("张三");
        //实现方法2.创建NormalMan对象
        NormalMan normalMan = new NormalMan("张三");

        normalMan.breath();
        normalMan.hasSex();
        normalMan.eat();
        normalMan.think();
        normalMan.study();
    }
}
